/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/
/*
Created by Amnon Drory for the course "Introduction To Systems Programming", 
School of Electrical Engineering, Tel-Aviv University. winter 2012.
*/
/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/

#ifndef HW1_OUTPUT_MANAGER_H
#define HW1_OUTPUT_MANAGER_H

/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/

#include "Hw1Types.h"

/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/

/**
 *
 */ 
typedef enum { AXN_REFUSED, AXN_ACCEPTED, AXN_RECEIVED_INVENTORY, AXN_SAVED_INVENTORY_DATA_TO_FILE } TAction;

/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/

/**
 * Initializes the Output Manager, Call this function before calling any other OutputMgr_
 * function. 
 * 
 * Input:
 * -----
 * A string used to initialize the output manager ( should be supplied to you 
 * from outside your program ).
 */ 
void OutputMgr_Initialize( const char* SetupString );

/**
 * Use this function to report to the Output Manager the store's action after it received
 * a request to but or sell a product.
 * IMPORTANT: this function should only be called if you have called
 * OutputMgr_Initialize() before.
 *
 * Inputs:
 * ------
 * Decision -    AXN_ACCEPTED: if the store decided to buy/sell
 *                AXN_REFUSED: if the store decided NOT to buy/sell.
 * TransactionData - The data of the purchase: the product's ID, the price, and the costumer ID. 
 *                     This must be filled in accurately even if Decision==AXN_REFUSED
 */ 
void OutputMgr_ReportTransaction( TAction Decision, TTransaction TransactionData );

/**
 * Use this function to report to the Output Manager that the store has received and handled
 * a request related to inventory: either a. add inventory from storage to the store, 
 * or b. Save the inventory to file.
 * IMPORTANT: this function should only be called if you have called
 * OutputMgr_Initialize() before.
 *
 * Input:
 * -----
 * Action - AXN_RECEIVED_INVENTORY: if inventory from storage was added to the store.
 *            AXN_SAVED_INVENTORY_DATA_TO_FILE: if inventory data was saved to a file.
 */ 
void OutputMgr_ReportInventory( TAction Action );

/**
 * Turns the Output Manager off, and releases all resources.
 * IMPORTANT: this function should only be called if you have called
 * OutputMgr_Initialize() before.
 */ 
void OutputMgr_Cleanup();

/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/

#endif // HW1_OUTPUT_MANAGER_H